package com.globo.devsup.client.presenter.listener;

import com.globo.devsup.client.presenter.PrincipalPresenter;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.event.PanelListenerAdapter;

public class PrincipalListener {

	public static class PrincipalPanelListener extends PanelListenerAdapter {
		private PrincipalPresenter presenter;
		
		public PrincipalPanelListener(PrincipalPresenter presenter) {
			super();
			this.presenter = presenter;
		}
		
		@Override
		public boolean doBeforeRender(Component component) {
			presenter.setOperation(presenter.LOAD_PANEL_STRATEGY);
			return super.doBeforeRender(component);
		}
		
		@Override
		public void onRender(Component component) {
			presenter.getOperation().execute();
			super.onRender(component);
		}
	}
}
